package com.example.lanqiaodemo1.JavaTest4;

public class Rectangle implements Shape{
    double x;
    double y;
    public Rectangle(double x, double y) {
        this.x = x;
        this.y = y;
    }
    public Rectangle(){};
    @Override
    public double getArea() {
        return x*y;
    }
    @Override
    public double getPerimeter() {
        return (x+y)*2;
    }
}
class test3{
    public static void main(String[] args) {
        Rectangle rectangle = new Rectangle(1,2);
        System.out.println(rectangle.getArea());
        System.out.println(rectangle.getPerimeter());
    }
}
